package com.example.mapper;

import com.example.pojo.Browse;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface BrowseMapper {
    @Insert("insert into browse(name, area, room_type, price, date, image, id_u, id_a) values (#{name}, #{area}, #{roomType}, #{price}, #{date}, #{image}, #{idU},#{idA})")
    void addBrowse(Browse browse);

    @Delete("delete from browse where id=#{id} and id_u=#{idU}")
    void delBrowse(Integer id, Integer idU);

    List<Browse> getBrowse(Integer integer, LocalDateTime date);


}